﻿using System.Collections.Generic;

namespace SilenthinkContract.Domain
{
    public class AppError : BaseEntity<int>
    {
        /// <summary>
        /// 
        /// </summary>
        public string Machine { get; set; }

        /// <summary>
        /// 
        /// </summary>
        public string Server { get; set; }

        /// <summary>
        /// 
        /// </summary>
        public string ServerIp { get; set; }

        /// <summary>
        /// 
        /// </summary>
        public byte Level { get; set; }

        /// <summary>
        /// 
        /// </summary>
        public string ExType { get; set; }

        /// <summary>
        /// 
        /// </summary>
        public string ExSource { get; set; }

        /// <summary>
        /// 
        /// </summary>
        public string ExMessage { get; set; }

        /// <summary>
        /// 
        /// </summary>
        public string ExStackTrace { get; set; }

        /// <summary>
        /// 
        /// </summary>
        public string Variables { get; set; }

        /// <summary>
        /// 
        /// </summary>
        public int StatusCode { get; set; }

        /// <summary>
        /// 
        /// </summary>
        public string Url { get; set; }

        /// <summary>
        /// 
        /// </summary>
        public string Referer { get; set; }

        /// <summary>
        /// 
        /// </summary>
        public string UserAgent { get; set; }

        /// <summary>
        /// 
        /// </summary>
        public string ClientIp { get; set; }

        public string LevelText
        {
            get
            {
                switch (Level)
                {
                    case 1:
                        return "低";
                    case 2:
                        return "一般";
                    case 3:
                        return "严重";
                }
                return string.Empty;
            }
        }
        
    }
}